From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 14 23:21:45 2006 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 14 23:21:45 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 14 23:21:45 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 14 23:21:45 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:45 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 14 23:21:45 2006 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:45 2006 Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 14 23:21:45 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 14 23:21:45 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Tue Mar 14 23:21:46 2006 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 14 23:21:46 2006 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:46 2006 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx@linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj@www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry@12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Tue Mar 14 23:21:46 2006 Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0001.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0001.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0001.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0001.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Tue Mar 28 18:25:05 2006 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 28 18:25:05 2006 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx@linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0001.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj@www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry@12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0001.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0001.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Tue Mar 28 18:25:05 2006 Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0002.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0002.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0002.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0002.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Tue Mar 28 20:17:05 2006 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 28 20:17:05 2006 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:05 2006 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx@linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0002.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx@linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj@www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry@12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry@12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry@12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0002.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx@linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces@linuxgrrls.org [mailto:rxtx-bounces@linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx@linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0002.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:05 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx@linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:06 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue Mar 28 20:17:06 2006 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Tue Mar 28 20:17:06 2006 Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0003.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0003.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0003.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0003.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0003.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0003.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0003.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0004.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0004.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0004.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0004.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0004.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0004.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0004.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0005.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0005.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0005.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0005.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0005.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0005.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0005.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0006.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0006.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0006.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0006.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0006.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0006.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0006.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0007.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0007.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0007.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0007.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0007.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0007.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0007.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0008.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0008.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0008.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0008.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0008.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0008.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0008.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0009.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0009.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0009.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0009.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0009.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0009.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0009.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0010.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0010.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0010.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0010.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0010.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0010.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0010.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0011.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0011.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0011.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0011.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0011.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0011.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0011.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0012.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0012.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0012.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0012.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0012.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0012.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0012.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0013.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0013.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0013.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0013.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0013.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0013.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0013.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0014.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0014.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0014.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0014.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0014.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0014.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0014.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0015.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0015.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0015.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0015.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0015.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0015.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0015.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0016.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0016.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0016.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0016.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0016.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0016.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0016.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0017.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0017.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0017.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0017.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0017.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0017.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0017.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0018.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0018.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0018.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0018.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0018.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0018.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0018.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0019.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0019.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0019.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0019.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0019.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0019.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0019.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0020.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0020.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0020.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0020.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0020.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0020.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0020.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0021.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0021.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0021.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0021.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0021.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0021.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0021.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0022.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0022.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0022.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0022.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0022.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0022.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0022.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0023.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0023.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0023.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0023.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0023.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0023.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0023.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0024.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0024.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0024.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0024.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0024.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0024.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0024.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0025.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0025.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0025.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0025.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0025.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0025.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0025.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0026.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0026.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0026.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0026.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0026.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0026.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0026.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0027.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0027.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0027.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0027.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0027.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0027.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0027.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0028.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0028.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0028.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0028.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0028.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0028.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0028.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0029.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0029.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0029.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0029.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0029.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0029.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0029.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0030.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0030.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0030.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0030.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0030.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0030.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0030.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0031.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0031.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0031.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0031.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0031.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0031.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0031.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0032.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0032.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0032.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0032.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0032.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0032.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0032.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0033.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0033.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0033.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0033.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0033.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0033.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0033.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0034.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0034.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0034.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0034.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0034.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0034.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0034.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0035.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0035.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0035.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0035.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0035.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0035.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0035.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0036.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0036.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0036.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0036.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0036.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0036.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0036.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0037.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0037.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0037.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0037.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0037.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0037.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0037.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0038.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0038.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0038.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0038.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0038.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0038.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0038.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0039.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0039.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0039.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0039.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0039.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0039.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0039.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0040.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0040.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0040.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0040.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0040.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0040.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0040.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0041.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0041.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0041.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0041.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0041.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0041.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0041.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0042.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0042.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0042.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0042.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0042.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0042.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0042.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0043.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0043.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0043.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0043.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0043.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0043.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0043.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0044.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0044.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0044.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0044.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0044.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0044.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0044.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0045.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0045.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0045.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0045.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0045.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0045.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0045.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0046.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0046.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0046.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0046.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0046.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0046.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0046.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0047.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0047.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0047.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0047.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0047.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0047.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0047.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0048.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0048.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0048.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0048.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0048.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0048.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0048.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0049.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0049.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0049.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0049.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0049.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0049.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0049.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0050.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0050.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0050.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0050.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0050.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0050.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0050.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0051.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0051.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0051.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0051.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0051.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0051.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0051.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0052.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0052.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0052.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0052.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0052.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0052.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0052.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0053.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0053.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0053.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0053.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0053.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0053.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0053.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0054.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0054.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0054.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0054.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0054.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0054.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0054.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0055.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0055.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0055.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0055.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0055.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0055.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0055.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0056.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0056.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0056.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0056.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0056.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0056.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0056.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0057.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0057.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0057.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0057.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0057.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0057.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0057.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0058.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0058.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0058.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0058.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0058.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0058.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0058.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0059.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0059.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0059.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0059.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0059.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0059.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0059.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0060.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0060.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0060.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0060.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0060.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0060.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0060.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0061.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0061.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0061.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0061.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0061.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0061.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0061.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0062.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0062.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0062.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0062.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0062.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0062.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0062.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0063.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0063.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0063.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0063.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:22:22 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:22:22 +0100 (BST) Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> References: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Message-ID: Great David. The w32 builds are ugly. The libmex is a library from an external project for debugging. I removed the link since its only useful there. I dont know the details of the Towitoko reader but it may well be possible that rxtx supports your work on Mac OS X too. There are binaries prebuilt in the source. Solaris is also tested. On Wed, 27 Aug 2003, David Garnier wrote: > Thanks Trent, but the problem was elsewhere. > > The solution is simple: do not use the Towitoko drivers at all, they do not > allow you to access the COM port. Instead, uninstall this driver and > install the drivers for the PL2303 chip inside the reader. These drivers > are available other there: > http://tech.prolific.com.tw/visitor/v_filebrw_result.asp > > > With these drivers I can connect to the USB reader just like a serial > reader, through COM3. > > I now have a single Java class that can communicate with any Towitoko > driver, serial or USB, Linux or Windows, without a single change. That's > portability! > > Anyway, I also manage to compile the RXTX library under Windows. That > wasn't really straightforward, but it worked in the end. For example, in > the makefile, there is a rule for a libmex.dll and make throws an error. I > don't think that its related to RXTX since I could not find this lib anywhere. > > Best Regards, > David Garnier > > At 18:56 26/08/2003 +0100, you wrote: > > > >On Tue, 26 Aug 2003, David Garnier wrote: > > > > > Hello, > > > > > > I have a problem accessing the COM port created by my USB card reader. > > Long > > > story short, it doesn't work with the official Comm API from Sun. Since it > > > work beautifully under Linux with the RXTX library, I was wondering if > > this > > > library could work well under Windows. > > > > > > Now if you are still interested, here is the whole story. > > > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > > use it under Windows 2000. For my application, I need to access the COM > > > port directly, without going through PCSC or another interface. The > > > documentation states that this is possible: the driver shoud create a > > > "virtual COM port" for me to use, if PCSC is disabled. > > > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > > API and it seems to working well with a serial reader. > > > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > > COM3 and the PCSC driver is not running. > > > > > > But when I try connect to the port from Java, I got a this message: > > > > > > No such Port COM: COM3 > > > > > > I think that the problem is related to the fact that the Comm API > > > enumerates only the serial port recorded in the registry (it's in the FAQ > > > for the Comm API). > > > > > > If I add a key for COM3 in the registry at > > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > > instead: > > > > > > Port COM COM3 is already used. > > > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > > either. > > > > > > >Hyperterminal does not work? hmm. > > > >Can you verify that the USB is working with this w32 at all? > > > >When RXTX enumerates ports, it tries to open the port and does a timed out > >read. If the OS does not complain (No such port for instance) then the > >port is taken to be good. > > > >You can force the enumeration to accept port 3 in SerialImp.c with > >something like (replace the function currently there): > > > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > > JNIEnv *env, > > jobject jobj, > > jstring tty_name, > > jint port_type > >) > >{ > > > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > > if( !strcmp( name, "COM3" ) > > { > > printf("%s is good\n",name); > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_TRUE ); > > } > > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > > return( JNI_FALSE ); > >} > > > >It would be random chance if rxtx did things the same way Sun does on w32. > >If you do use rxtx on w32 you want to use 2.1-7pre16 > > > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > > > >These are in package gnu.io so remove all previous packages before trying > >it. Conflicts are common. Just change the code in your file to use > >package gnu.io and it should work. -- except you say hyperterm is not > >working... > >_______________________________________________ > >Rxtx mailing list > >Rxtx at linuxgrrls.org > >http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From ricardo.trindade at emation.pt Wed Aug 27 02:23:26 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:23:26 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: the board you describe is a converter from 422 to 485. you need a converter from 232 to 485, since your pc will have 232 (standard serial port). 422 is a different flavour of 485, being the main difference that it uses 4 wires and is full duplex. if you want to go with 485.com you must buy one marked with RS232<=>RS485 in their catalog. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 27 de Agosto de 2003 0:58 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/72951476/attachment-0063.html From ricardo.trindade at emation.pt Wed Aug 27 02:26:13 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Wed, 27 Aug 2003 09:26:13 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: actually there was a mistake in the original post, it wasn't a board, it was a 422-485 converter. Piero : When you say board we assume something you insert in a isa or pci slot of you pc. (at least I do). -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Trent Jarvi Enviada: quarta-feira, 27 de Agosto de 2003 5:14 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx From taj at linuxgrrls.org Wed Aug 27 02:45:59 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 09:45:59 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: References: Message-ID: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From Scott.Hughes at dalsemi.com Wed Aug 27 11:26:15 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Wed, 27 Aug 2003 12:26:15 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> > So far, I've just been watching the 1.4 JRE and recommending > 1.3 JRE. > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > untested currently. The big change in Java since the initial > tests was > the NPTL on Linux. Can you think of any reason that 2.1-6 would work in that same jre 1.4 environment and 2.1-7pre16 wouldn't? Also, I noticed that even though I remove any event listeners and explicitly close the port, that MonitorThread still hangs around. Any of the 1-Wire examples we have that don't call System.exit end up hanging on that thread. Any idea what I might be doing wrong there? And lastly, I always get these "stale lock file" messages. Is that related to the above problem? And on another, completely different subject, I'm trying to build 2.1.6 with mingw32 from cygwin. Does anyone have an updated build script or makefile that works in this scenario. I noticed the current makefile is expecting a DOS environment. I went through and replaced all the "\\" with "/" and any dos specific command (i.e. xcopy) with it's unixy equivalent... But I still can't make it all the way through. Thanks for your help! Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From david.garnier at trusted-logic.com Wed Aug 27 11:31:55 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 19:31:55 +0200 Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.c om> Message-ID: <5.2.0.9.0.20030827192957.02a92998@mail.trusted-logic.fr> You can have mine. It works under win2k with the last version of mingw. Don't forget to run ./configure in the top directory first. Best Regards, David Garnier At 12:26 27/08/2003 -0500, you wrote: > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > >Can you think of any reason that 2.1-6 would work in that same jre 1.4 >environment and 2.1-7pre16 wouldn't? > >Also, I noticed that even though I remove any event listeners and explicitly >close the port, that MonitorThread still hangs around. Any of the 1-Wire >examples we have that don't call System.exit end up hanging on that thread. >Any idea what I might be doing wrong there? > >And lastly, I always get these "stale lock file" messages. Is that related >to the above problem? > >And on another, completely different subject, I'm trying to build 2.1.6 with >mingw32 from cygwin. Does anyone have an updated build script or makefile >that works in this scenario. I noticed the current makefile is expecting a >DOS environment. I went through and replaced all the "\\" with "/" and any >dos specific command (i.e. xcopy) with it's unixy equivalent... But I still >can't make it all the way through. > >Thanks for your help! > >Scott >-- >Scott Hughes - Engineer >shughes aht dalsemi daut com >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------- next part -------------- #------------------------------------------------------------------------- # rxtx is a native interface to serial ports in java. # Copyright 1997-2002 by Trent Jarvi taj at www.linux.org.uk. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Library General Public License for more details. # # You should have received a copy of the GNU Library General Public # License along with this library; if not, write to the Free # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #------------------------------------------------------------------------- # This Makefile works on windows 98/NT with mingw32 in a DOS shell # One catch. We cant figure out how to generate .def files with default # DOS tools and mingw32. Install Cygwin if you are adding/removing/chaninging # C functions. # mingw build tools are used # PATH=c:\mingw\bin;c:\jdk118\bin;%PATH% # mingw32 version 1.0.1-20010726 # jdk was 1.1.8 # java.sun.com ###################### # user defined variables ###################### # path to the source code (directory with SerialImp.c) Unix style path SRC=../src # and the dos path DOSSRC=..\\\src # path to the jdk directory that has include, bin, lib, ... Unix style path JDKHOME=C:/j2sdk1.4.2_01 #path to mingw32 MINGHOME="C:/MinGW" # path to install RXTXcomm.jar DOS style path COMMINSTALL="C:\j2sdk1.4.2_01\lib" # path to install the shared libraries DOS style path LIBINSTALL="C:\j2sdk1.4.2_01\bin" # path to the mingw32 libraries (directory with libmingw32.a) DOS style path LIBDIR="C:\MinGW\lib" ###################### # End of user defined variables ###################### ###################### # Tools ###################### AS=as CC=gcc LD=ld DLLTOOL=dlltool # this looks like a nice tool but I was not able to get symbols in the dll. DLLWRAP=dllwrap CLASSPATH=-classpath ".;" #C:\jdk13\lib\RXTXcomm.jar;c:\BlackBox.jar;c:\jdk13\lib\classes.zip" JAVAH=javah $(CLASSPATH) JAR=jar JAVAC=javac $(CLASSPATH) ###################### # Tool Flags ###################### CFLAGS_CYGWIN= -O2 $(INCLUDE) -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall #CFLAGS= -O2 $(INCLUDE) -mno-cygwin -DWIN32 -D __int64="long long" -mno-fp-ret-in-387 -Wall -D TRENT_IS_HERE_DEBUGGING_ENUMERATION -DTRENT_IS_HERE_DEBUGGING_THREADS INCLUDE= -I c:\matlab6p5/extern/include/ -I . -I $(JDKINCLUDE) -I $(JDKINCLUDE)/win32 -I $(SRC) -I include -I $(MINGINCLUDE) JAVAHFLAGS= -jni -d include LIBS=-L . -L $(LIBDIR) -LC:/tmp/rxtx5/build -luser32 -lgdi32 -lcomdlg32 -lkernel32 -ladvapi32 -lmoldname -lcrtdll # -lmex # path to the java native interface headers (directory with jni.h) JDKINCLUDE=$(JDKHOME)/include MINGINCLUDE=$(MINGHOME)/include JAVAFILES = $(wildcard $(SRC)/*.java) CFILES=$(wildcard $(SRC)/*.c) $(wildcard $(SRC)/*.cc) TARGETLIBS= rxtxSerial.dll rxtxParallel.dll #TARGETLIBS= rxtxSerial.dll rxtxParallel.dll rxtxZystem.dll DLLOBJECTS= fixup.o SerialImp.o termios.o init.o fuserImp.o PARALLELOBJECTS= ParallelImp.o termios.o init.o all: $(TARGETLIBS) # rebuild rebuild will force everything to be built. rebuild: rm -rf gnu include RXTXcomm.jar Serial.* rxtxSerial.* * *.O.o *.O gnutimestamp include: mkdir include gnu: mkdir gnu mkdir gnu\\\io # yayaya We should have put the files in gnu.io to start with gnutimestamp: $(JAVAFILES) $(CFILES) include gnu xcopy $(DOSSRC)\\*.* gnu\\io\\ echo > gnutimestamp # FIXME make 3.79.1 behaves really strage if we use %.o rules. init.o: $(CC) $(CFLAGS) -c $(SRC)/init.cc -o init.o fixup.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o fixup.o #ZystemImp.o: include/config.h # $(CC) $(CFLAGS_CYGWIN) -c $(SRC)/ZystemImp.c -o ZystemImp.o SerialImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/SerialImp.c -o SerialImp.o fuserImp.o: $(CC) $(CFLAGS) -c $(SRC)/fuserImp.c -o fuserImp.o termios.o: $(CC) $(CFLAGS) -c $(SRC)/$*.c -o termios.o ParallelImp.o: include/config.h $(CC) $(CFLAGS) -c $(SRC)/$*.c -o ParallelImp.o # This file is a pain in the rear to generate. If your looking at this you # need to install cygwin. #$(SRC)/Zystem.def: $(DLLOBJECTS) ZystemImp.o #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #xcopy /Y $(DOSSRC)\\Zystem.def gnu\\io\\ $(SRC)/Serial.def: $(DLLOBJECTS) $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Serial.def gnu\\io\\ # echo EXPORTS >$(SRC)/Serial.def;for i in `nm rxtxSerial.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Serial.def $(SRC)/Parallel.def: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 xcopy $(DOSSRC)\\Parallel.def gnu\\io\\ # echo EXPORTS >$(SRC)/Parallel.def;for i in `nm rxtxParallel.dll | grep "T _Java"|cut -b 13-`;do echo -n $$i|sed s#@.*##;echo "="$$i;done >> $(SRC)/Parallel.def rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) #ZystemImp.o $(SRC)/Zystem.def gcc -c -DBUILDING_DLL=1 -D_DLL=1 -I. -Ic:/jdk13/include -Ic:/jdk13/include/win32 -Wall -O2 -D __int64="long long" -o ZystemImp.o $(SRC)/ZystemImp.c dllwrap --verbose --no-default-excludes --export-all-symbols --output-exp Zystem.exp --output-def Zystem.def --add-stdcall-alias --driver-name gcc -o rxtxZystem.dll ZystemImp.o libmex.dll -Wl,-e,__cygwin_noncygwin_dll_entry at 12 -s #rxtxZystem.dll: RXTXcomm.jar $(DLLOBJECTS) ZystemImp.o $(SRC)/Zystem.def #$(LD) --base-file Zystem.base --dll -o rxtxZystem.dll $(DLLOBJECTS) \ #ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 #$(DLLTOOL) --as=$(AS) --dllname rxtxZystem.dll --def $(SRC)/Zystem.def \ #--base-file Zystem.base --output-exp Zystem.exp #$(LD) --base-file Zystem.base Zystem.exp -dll -o rxtxZystem.dll \ #$(DLLOBJECTS) ZystemImp.o _divdi3.o $(LIBS) -lcygwin -e _dll_entry at 12 rxtxSerial.dll: RXTXcomm.jar $(DLLOBJECTS) $(SRC)/Serial.def $(LD) --base-file Serial.base --dll -o rxtxSerial.dll $(DLLOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxSerial.dll --def $(SRC)/Serial.def \ --base-file Serial.base --output-exp Serial.exp $(LD) --base-file Serial.base Serial.exp -dll -o rxtxSerial.dll \ $(DLLOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 # # This should replace the mess above if it worked. # nm shows no symbols in the dll produced. The old stuff above works ok. # $(DLLWRAP) --output-def $*.def --output-exp $*.exp \ # --add-stdcall-alias --driver-name gcc -mwindows \ # --target=i386-mingw32 -o $*.dll $(DLLOBJECTS) $(LIBS) -s # -mno-cygwin rxtxParallel.dll: $(PARALLELOBJECTS) $(LD) --base-file Parallel.base --dll -o rxtxParallel.dll $(PARALLELOBJECTS) \ $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 $(DLLTOOL) --as=$(AS) --dllname rxtxParallel.dll --def $(SRC)/Parallel.def \ --base-file Parallel.base --output-exp Parallel.exp $(LD) --base-file Parallel.base Parallel.exp -dll -o rxtxParallel.dll \ $(PARALLELOBJECTS) $(LIBS) -lmingw32 -e _dll_entry at 12 RXTXcomm.jar: gnutimestamp $(JAVAC) gnu\\io\\*.java $(JAR) -cf RXTXcomm.jar gnu\\io\\*.class $(JAVAH) $(JAVAHFLAGS) $(patsubst gnu/io/%.java,gnu.io.%,$(wildcard gnu/io/*.java)) include/config.h: gnutimestamp echo "#define HAVE_FCNTL_H 1" > include\\\config.h echo "#define HAVE_SIGNAL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FCNTL_H 1" >> include\\\config.h echo "#define HAVE_SYS_FILE_H 1" >> include\\\config.h echo "#undef HAVE_SYS_SIGNAL_H" >> include\\\config.h echo "#undef HAVE_TERMIOS_H" >> include\\\config.h install: all xcopy RXTXcomm.jar $(COMMINSTALL) xcopy RXTXcomm.jar "e:\matlab~1\java\jarext\commapi\win32" xcopy $(TARGETLIBS) $(LIBINSTALL) xcopy $(TARGETLIBS) "e:\matlab~1\bin\win32" uninstall: del $(COMMINSTALL)\\\RXTXcomm.jar del $(LIBINSTALL)\\\$(TARGETLIBS) clean: deltree gnu\\\io\\\*.* deltree include del Serial.* gnutimestamp *.o *.O RXTXcomm.jar rxtxSerial.* From taj at linuxgrrls.org Wed Aug 27 20:45:40 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 03:45:40 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB7F2@misnts1.dalsemi.com> Message-ID: Hi Scott. hmm lots of questions here. On Wed, 27 Aug 2003, Scott Hughes wrote: > > > So far, I've just been watching the 1.4 JRE and recommending > > 1.3 JRE. > > Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly > > untested currently. The big change in Java since the initial > > tests was > > the NPTL on Linux. > > Can you think of any reason that 2.1-6 would work in that same jre 1.4 > environment and 2.1-7pre16 wouldn't? hmm. This is a great observation. I'm going on a bike ride across the rockies friday so I'll be out about a week but this does offer a means to get around or isolate what is going on. As I mentioned, I've had limited testing with 1.4 jre's but I should be able to track theis down with the above. > > Also, I noticed that even though I remove any event listeners and explicitly > close the port, that MonitorThread still hangs around. Any of the 1-Wire > examples we have that don't call System.exit end up hanging on that thread. > Any idea what I might be doing wrong there? > This is a known bug with a workoround for in rxtx. We need to move code around in rxtx for the above to work. What you want to do for now is the following: open() add event Listener close() [close shuts down the event listener] If you call close without an event listener, rxtx will sit there waiting for the event listener to shut down (deadlock). This is something I've been intending to fix but constantly get pulled into other things. > And lastly, I always get these "stale lock file" messages. Is that related > to the above problem? > If you do not call close, the lock file will remain and be recognized as stale the next time an application tries to use the post. see below. When I put the lock file code in, I assumed finalize() would be called and removed lockfiles there but it turns out that is not the case. > And on another, completely different subject, I'm trying to build 2.1.6 with > mingw32 from cygwin. Does anyone have an updated build script or makefile > that works in this scenario. I noticed the current makefile is expecting a > DOS environment. I went through and replaced all the "\\" with "/" and any > dos specific command (i.e. xcopy) with it's unixy equivalent... But I still > can't make it all the way through. > > Thanks for your help! > w32 builds.. cygwin: I have not had luck with the cygwin version of mingw32 in ages. even if I do install cygwin tools (especially grep and sed) I place the real mingw32 in the front of my path and just blow off the cygwin gcc/mingw32. http://www.mingw.org/ If you do want to build in a cygwin bash shell, I think configure will still work. Its really been ages though. You only need a few tools to build rxtx on w32. I've always used just a few tools from cygwin and mingw in dos shells for other reasons. 1) there is no confusion that rxtx is not linking against cygwin.dll thus rendering rxtx GPL vs LGPL. 2) w32 for me is a vmware instance with very limited resources. In fact I usually use a gcc cross compiler for win32 and have test applications, rxtx, ... smb shared from a linux box. This way I can test each w32 by just clicking on the vmware instance in question and have it autorun tests. No need for multiple source trees or multiple installs. From pcolagrosso at yahoo.com Thu Aug 28 09:18:31 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Thu, 28 Aug 2003 08:18:31 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Just one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030828/9b501055/attachment-0063.html From taj at linuxgrrls.org Thu Aug 28 10:05:26 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Thu, 28 Aug 2003 17:05:26 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> References: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: Hi Piero As I mentioned, I have little experience with RS485. I asked around a bit and learned that Arcom does make boards that work under linux. Lets just say there was mumbling and grumbling between breaths on the subject of internal RS485 boards in general. I've got one more person to ask but thats probably going to be about all I can find. On Thu, 28 Aug 2003, Piero Colagrosso wrote: > Hi guys, > > Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. > > A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. > > We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. > > However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. > > Thanks, > > Piero > > > > > > Trent Jarvi wrote: > > > Thanks Ricardo > > Yes I assumed an internal pci or isa board when I read 'board.' > > On Wed, 27 Aug 2003, Ricardo Trindade wrote: > > > actually there was a mistake in the original post, it wasn't a board, it was > > a 422-485 converter. > > > > Piero : When you say board we assume something you insert in a isa or pci > > slot of you pc. (at least I do). > > > > -----Mensagem original----- > > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > > nome de Trent Jarvi > > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > > Para: Java RXTX discussion > > Assunto: RE: [Rxtx] RS-485 Support > > > > > > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > > > Hi Ricardo, > > > > > > Thanks for the explanations. > > > > > > Just one more thing I would like to verify with you, just to make sure > > I've understood correctly: > > > > > > I'm aware that there are also some RS-485 boards that also do the > > automatic transmit control in hardware (e.g., > > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > > this type of board as with the RS232->RS485 you mentioned in your initial > > response? Also, from an RXTX point of view could I still treat this RS-485 > > port as if it were an RS-232 port? > > > > > > Thanks, > > > > > > Piero: > > > > So far as I know, the RS485 boards have not been tested with rxtx. They > > should behave like other tty drivers and any missing functionality > > _should_ be handled in rxtx. > > > > While very possible, you may end up tinkering with the native code before > > the internal RS485 boards work. As a quick hack to test them, you could > > make say /dev/ttyS32 a symbolic link to whatever the kernel expects the > > port to be at. > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > > _______________________________________________ > > Rxtx mailing list > > Rxtx at linuxgrrls.org > > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > --------------------------------- > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site design software From Scott.Hughes at dalsemi.com Thu Aug 28 14:18:29 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Thu, 28 Aug 2003 15:18:29 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Trent, > In fact I usually use a gcc cross > compiler for win32 and have test applications, rxtx, ... smb > shared from a > linux box. This way I can test each w32 by just clicking on > the vmware > instance in question and have it autorun tests. No need for multiple > source trees or multiple installs. Is the process for cross-compiling rxtx documented anywhere? Or should I just pick up a tutorial on cross-compiling in general? It's new territory for me. I just tried it on my debian system. Here's pretty much what I did: apt-get install mingw32 ./configure --target=i586-mingw32msvc --host=i686-pc-linux --build=i586-mingw32msvc make But that didn't actually get me a dll... Nor did it get me any lib*.so files, so I must be close. I then tried: make i586-mingw32msvc/rxtxSerial.dll And that came back with the error "cannot execute cpp0". I tried changing all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get that some headers are missing (the exact same errors I got when I tried to use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, sys/signal.h. Any ideas? Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From ricardo.trindade at emation.pt Thu Aug 28 17:02:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Fri, 29 Aug 2003 00:02:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030828151831.5737.qmail@web13907.mail.yahoo.com> Message-ID: The site doesn't state wether the board handles automatic send data control. most bb equipment does, but be sure to check with them. believe me, you want a board/converter that has hw sdc. About linux support, ask them. If you can get a tty in linux it should work fine. -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quinta-feira, 28 de Agosto de 2003 16:19 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi guys, Thanks for pointing out the error. Yes, I meant an internal PCI RS-485 board, so the example I sent was incorrect. A better example would have been the 422/485 board manufactured by Quatech and also distributed by B&B (http://www.bb-elec.com/product.asp?sku=QSC-200/300&PathId=593). This board provides four indpendendent serial ports. We are considering the use of internal 485 boards because our system will require multiple (at least 2) 485 network connections. Since most PC chipsets come with a single RS-232 serial connection, using an internal RS-485 multiport PCI board seems to be the best and most cost effective alternative for supporting 2 or more ports. However, on the application software side we are also assessing the effort involved in interfacing with this type of board on an Linux system. This is why we are investigating RXTX as a solution for interfacing with this (or another) RS-485 board. Thanks, Piero Trent Jarvi wrote: Thanks Ricardo Yes I assumed an internal pci or isa board when I read 'board.' On Wed, 27 Aug 2003, Ricardo Trindade wrote: > actually there was a mistake in the original post, it wasn't a board, it was > a 422-485 converter. > > Piero : When you say board we assume something you insert in a isa or pci > slot of you pc. (at least I do). > > -----Mensagem original----- > De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em > nome de Trent Jarvi > Enviada: quarta-feira, 27 de Agosto de 2003 5:14 > Para: Java RXTX discussion > Assunto: RE: [Rxtx] RS-485 Support > > > > > On Tue, 26 Aug 2003, Piero Colagrosso wrote: > > > Hi Ricardo, > > > > Thanks for the explanations. > > > > Ju st one more thing I would like to verify with you, just to make sure > I've understood correctly: > > > > I'm aware that there are also some RS-485 boards that also do the > automatic transmit control in hardware (e.g., > http://www.rs485.com/prsfc44t.html). Would I get the same advantage with > this type of board as with the RS232->RS485 you mentioned in your initial > response? Also, from an RXTX point of view could I still treat this RS-485 > port as if it were an RS-232 port? > > > > Thanks, > > > Piero: > > So far as I know, the RS485 boards have not been tested with rxtx. They > should behave like other tty drivers and any missing functionality > _should_ be handled in rxtx. > > While very possible, you may end up tinkering with the native code before > the internal RS485 boards work. As a quick hack to test them, you could > make sa y /dev/ttyS32 a symbolic link to whatever the kernel expects the > port to be at. > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030829/1bab8f24/attachment-0063.html From taj at linuxgrrls.org Thu Aug 28 18:08:05 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 01:08:05 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: I have this documented somewhat in INSTALL if you look for ----------------- cross-compiling from Linux ----------------- Getting into building cross-compilers is probably something you dont even want to hear about but there are links to prebuilt cross compilers in the INSTALL documentation. Once installed you just do something like the following: mkdir build cd build ../configure --target=i386-mingw32 --host=i386-redhat-linux make Then I usually just write a small script to perform install into the SMB tree. On Thu, 28 Aug 2003, Scott Hughes wrote: > Trent, > > > In fact I usually use a gcc cross > > compiler for win32 and have test applications, rxtx, ... smb > > shared from a > > linux box. This way I can test each w32 by just clicking on > > the vmware > > instance in question and have it autorun tests. No need for multiple > > source trees or multiple installs. > > Is the process for cross-compiling rxtx documented anywhere? Or should I > just pick up a tutorial on cross-compiling in general? It's new territory > for me. > > I just tried it on my debian system. Here's pretty much what I did: > > apt-get install mingw32 > ./configure --target=i586-mingw32msvc --host=i686-pc-linux > --build=i586-mingw32msvc > make > > But that didn't actually get me a dll... Nor did it get me any lib*.so > files, so I must be close. I then tried: > > make i586-mingw32msvc/rxtxSerial.dll > > And that came back with the error "cannot execute cpp0". I tried changing > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > that some headers are missing (the exact same errors I got when I tried to > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > sys/signal.h. > > Any ideas? > > Scott > -- > Scott Hughes - Engineer > shughes aht dalsemi daut com > _______________________________________________ > Rxtx mailing list > Rxtx at linuxgrrls.org > http://hex.linuxgrrls.org/mailman/listinfo/rxtx > From taj at linuxgrrls.org Thu Aug 28 20:22:34 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:22:34 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: On Fri, 29 Aug 2003, Trent Jarvi wrote: > > And that came back with the error "cannot execute cpp0". I tried changing > > all the calls to "gcc" under that target to "i586-mingw32msvc-gcc" and I get > > that some headers are missing (the exact same errors I got when I tried to > > use mingw32 on WinXP to compile the dll). Missing pwd.h, grp.h, > > sys/signal.h. > > > > Any ideas? > > > > Scott I'm not familiar with debians packages but often the packages get installed in /usr/local/bin. That directory should be at the front of your path so gcc can know it has the cross-compiler. If nothing else I can give you a ssh account on my box later next week. From taj at linuxgrrls.org Thu Aug 28 20:25:52 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Fri, 29 Aug 2003 03:25:52 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: References: <1809DA15308DD51180EE00508BCF219414FEBA63@misnts1.dalsemi.com> Message-ID: Here is the script I use to build w32 on linux. rm -f config.cache config.h config.status export WIN32INCLUDE=/home/bob/win32-include export PATH=/usr/local/cross-tools/i386-mingw32/bin/:/bin:/usr/bin:/usr/local/jd k1.2/bin/: ../configure --target=i386-mingw32 --host=i386-pc-linux --build=i386-mingw32 make WIN32INCLUDE contains the Java include files ls ../win32-include/ jni.h jvmdi.h jvmpi.h win32 /usr/local/cross-tool/mingw32 is just the cross compiler linked to in INSTALL. From reggiehg_t at yahoo.com Sat Aug 30 01:07:01 2003 From: reggiehg_t at yahoo.com (Reggie Guevara) Date: Sat, 30 Aug 2003 00:07:01 -0700 (PDT) Subject: [Rxtx] rxtx archives In-Reply-To: <3F463018.7070102@gmx.ch> Message-ID: <20030830070701.41687.qmail@web80606.mail.yahoo.com> Hi, I get a "404 Not Found" surfing http://hex.linuxgrrls.org/pipermail/rxtx/ Any alternatives? TIA, Reggie __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com From ricardo.trindade at emation.pt Mon Aug 25 03:26:50 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 10:26:50 +0100 Subject: [Rxtx] rxtxwin32 In-Reply-To: Message-ID: I guess a good place to start is to clear up some confusion on my part. Are we talking about enableReceiveFraming( int frammingByte )? R:I do no think this is what is needed. A higher level api would be needed, in wich the application programmer could give rxtx a method to determine wether the terminating character has been reached. But you would like this to perhaps happen on write()? Maybe: write( ..., int frammingByte ); ? R: I don't think it's essential to do it on write, because the application programmer knows how many bytes he needs to write, and therefore can give that info to write. Perhaps people with different requirements could add extra feedback here. From pcolagrosso at yahoo.com Mon Aug 25 06:23:54 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Mon, 25 Aug 2003 05:23:54 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/554d4e09/attachment-0064.html From ricardo.trindade at emation.pt Mon Aug 25 10:14:11 2003 From: ricardo.trindade at emation.pt (Ricardo Trindade) Date: Mon, 25 Aug 2003 17:14:11 +0100 Subject: [Rxtx] RS-485 Support In-Reply-To: <20030825122354.24310.qmail@web13904.mail.yahoo.com> Message-ID: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx -------------------------------------------------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx ---------------------------------------------------------------------------- -- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030825/a886b8e4/attachment-0064.html From Scott.Hughes at dalsemi.com Tue Aug 26 00:31:46 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 01:31:46 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> I'm having a little trouble getting a working build of 2.1.x for linux. I downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems to depend on Sun's comm.jar, which I thought should be unnecessary for rxtx2.1. Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. I'm getting the following error: java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading gnu.io.RXTXCommDriver Shouldn't 2.1 not require this class? Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is the linux binary for this release. Or, if I could figure out where to get the right source, I could just build a fresh win32 and linux lib from that. I'd prefer building from the latest source, since I believe some of the intermittent problems I was having were fixed somewhere between 2.1.7-pre12 and 2.1.7-pre16. Sorry if this message seems a bit rtfm for the list, but tfm could use a bit of an update and the list doesn't seem searchable yet. Thanks for your help... Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From taj at linuxgrrls.org Tue Aug 26 02:26:17 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 09:26:17 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB46E@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > I'm having a little trouble getting a working build of 2.1.x for linux. I > downloaded rxtx-2.1-6.tar.gz and tried to build from that... But that seems > to depend on Sun's comm.jar, which I thought should be unnecessary for > rxtx2.1. > > Doing a "cvs checkout rxtx-devel" seems to be pretty much the same problem. > I'm getting the following error: > > java.lang.NoClassDefFoundError: javax/comm/CommDriver thrown while loading > gnu.io.RXTXCommDriver > > Shouldn't 2.1 not require this class? > > Also, somehow I got my hands on a win32 rxtxSerial.dll and a RXTXcomm.jar > for 2.1.7-pre16.. But I don't know where I found it. What I'm missing is > the linux binary for this release. Or, if I could figure out where to get > the right source, I could just build a fresh win32 and linux lib from that. > > I'd prefer building from the latest source, since I believe some of the > intermittent problems I was having were fixed somewhere between 2.1.7-pre12 > and 2.1.7-pre16. > > Sorry if this message seems a bit rtfm for the list, but tfm could use a bit > of an update and the list doesn't seem searchable yet. > > Thanks for your help... > Hi Scott. I suspect you have some conflicting jar files in your classpath. RXTX 2.1 has no code references to javax.comm as it is package gnu.io. I just double checked CVS to make sure. Make sure you have no reference to javax.comm in your code, check your classpath and make sure you don't have something old hanging around in .../java/jre/lib/ext. Finally, if you checkout from CVS make sure you get hte 2.1 code with: cvs checkout -r commapi-0-0-1 rxtx-devel This is the grep from CVS rxtx-devel/src servertrent src]# grep javax * SerialImp.c: accept: javax.comm.SerialPort.PARITY_* constant SerialImp.c:This seems to jive with the way I'm reading it which is the javax.comm SerialImp.c:> forever. I pulled the following info from the javax.comm doc for the CommPort class in From david.garnier at trusted-logic.com Tue Aug 26 07:28:36 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Tue, 26 Aug 2003 15:28:36 +0200 Subject: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Hello, I have a problem accessing the COM port created by my USB card reader. Long story short, it doesn't work with the official Comm API from Sun. Since it work beautifully under Linux with the RXTX library, I was wondering if this library could work well under Windows. Now if you are still interested, here is the whole story. I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to use it under Windows 2000. For my application, I need to access the COM port directly, without going through PCSC or another interface. The documentation states that this is possible: the driver shoud create a "virtual COM port" for me to use, if PCSC is disabled. Furthermore, I need to do this under Java. I have installed the Java Comm API and it seems to working well with a serial reader. According to the Chipdrive Diagnostic software, the reader is attached to COM3 and the PCSC driver is not running. But when I try connect to the port from Java, I got a this message: No such Port COM: COM3 I think that the problem is related to the fact that the Comm API enumerates only the serial port recorded in the registry (it's in the FAQ for the Comm API). If I add a key for COM3 in the registry at HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: Port COM COM3 is already used. I tried to connect to the port using Hyperterminal and it didn't worked either. Any idea? Best Regards, David Garnier From taj at linuxgrrls.org Tue Aug 26 11:56:16 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Tue, 26 Aug 2003 18:56:16 +0100 (BST) Subject: [Rxtx] Towitoko USB reader under Windows In-Reply-To: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: On Tue, 26 Aug 2003, David Garnier wrote: > Hello, > > I have a problem accessing the COM port created by my USB card reader. Long > story short, it doesn't work with the official Comm API from Sun. Since it > work beautifully under Linux with the RXTX library, I was wondering if this > library could work well under Windows. > > Now if you are still interested, here is the whole story. > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > use it under Windows 2000. For my application, I need to access the COM > port directly, without going through PCSC or another interface. The > documentation states that this is possible: the driver shoud create a > "virtual COM port" for me to use, if PCSC is disabled. > > Furthermore, I need to do this under Java. I have installed the Java Comm > API and it seems to working well with a serial reader. > > According to the Chipdrive Diagnostic software, the reader is attached to > COM3 and the PCSC driver is not running. > > But when I try connect to the port from Java, I got a this message: > > No such Port COM: COM3 > > I think that the problem is related to the fact that the Comm API > enumerates only the serial port recorded in the registry (it's in the FAQ > for the Comm API). > > If I add a key for COM3 in the registry at > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message instead: > > Port COM COM3 is already used. > > I tried to connect to the port using Hyperterminal and it didn't worked > either. > Hyperterminal does not work? hmm. Can you verify that the USB is working with this w32 at all? When RXTX enumerates ports, it tries to open the port and does a timed out read. If the OS does not complain (No such port for instance) then the port is taken to be good. You can force the enumeration to accept port 3 in SerialImp.c with something like (replace the function currently there): JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( JNIEnv *env, jobject jobj, jstring tty_name, jint port_type ) { const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); if( !strcmp( name, "COM3" ) { printf("%s is good\n",name); (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_TRUE ); } (*env)->ReleaseStringUTFChars( env, tty_name, name ); return( JNI_FALSE ); } It would be random chance if rxtx did things the same way Sun does on w32. If you do use rxtx on w32 you want to use 2.1-7pre16 ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ These are in package gnu.io so remove all previous packages before trying it. Conflicts are common. Just change the code in your file to use package gnu.io and it should work. -- except you say hyperterm is not working... From Scott.Hughes at dalsemi.com Tue Aug 26 13:26:30 2003 From: Scott.Hughes at dalsemi.com (Scott Hughes) Date: Tue, 26 Aug 2003 14:26:30 -0500 Subject: [Rxtx] Building 2.1.x from source Message-ID: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> > cvs checkout -r commapi-0-0-1 rxtx-devel Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux from this source. Also, I had a file called jcl.jar which somehow snuck it's way into my jre/lib/ext folder and gave a conflicting definition for gnu.io.RXTXCommDriver. That was a pain to track down.. Now, I'm getting an unexpected exception from the native lib. It looks like it is happening during the constructor for CommPortIdentifier but is actually occurring in RXTXCommDriver.testRead(). Here's the exact output: Devel Library ========================================= Native lib Version = RXTX-2.1-7pre16 Java lib Version = RXTX-2.1-7pre16 An unexpected exception has been detected in native code outside the VM. Unexpected Signal : 11 occurred at PC=0x4C403A1A Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so Current Java thread: at gnu.io.RXTXCommDriver.testRead(Native Method) at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) at gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) at com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer vice.java:195) at com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: 337) at com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess Provider.java:199) at FindiButtonsConsole.main(Unknown Source) Scott -- Scott Hughes - Engineer shughes aht dalsemi daut com From pcolagrosso at yahoo.com Tue Aug 26 17:58:14 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:14 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/44bac4e9/attachment-0064.html From pcolagrosso at yahoo.com Tue Aug 26 17:58:04 2003 From: pcolagrosso at yahoo.com (Piero Colagrosso) Date: Tue, 26 Aug 2003 16:58:04 -0700 (PDT) Subject: [Rxtx] RS-485 Support In-Reply-To: Message-ID: <20030826235804.85094.qmail@web13903.mail.yahoo.com> Hi Ricardo, Thanks for the explanations. Just one more thing I would like to verify with you, just to make sure I've understood correctly: I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? Thanks, Piero Ricardo Trindade wrote: Hi, Yes, you can build a protocol on top of a converter + rxtx. You just treat the 485 port as if it were 232. You will have to deal with some kind of token passing (a la token ring), to decide who has the right to write to the bus. (at least this is how I read about it), since you should never have two devices writing to the bus at once. In some older equips I read in the manual that this could even damage the hardware (probably not true anymore...). ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: segunda-feira, 25 de Agosto de 2003 13:24 Para: Java RXTX discussion Assunto: RE: [Rxtx] RS-485 Support Hi Ricardo, Thanks for the advice regarding the 232->485 converter. Regarding the API, I can clarify a little bit what I meant. Since we intend to build a peer-to-peer protocol over RS-485 (i.e., Bacnet MS/TP), what I was looking to understand is whether I can use an API such as RXTX in combination with the 232->485 converter to implement this peer-to-peer protocol. What I understand is that this should be OK as long as I keep in mind that 232 is full-duplex whereas the 485 is half-duplex (in the typical 2 wire configuration). Do you agree? Thanks, Piero Ricardo Trindade wrote: I'd like to second the opinions that advise you to buy a 232->485 hw converter. They are very cheap, you can get automatic direction control, which means you won't have to manually drive the request to send, etc.. I have some from advantech, and some from B&B, both work great. you can also get them optically isolated, if you need it. as for your second question, what do you mean by API in this scenario ? 485 is just an electrical spec, so you can't implement a general 485 protocol. ricardo -----Mensagem original----- De: rxtx-bounces at linuxgrrls.org [mailto:rxtx-bounces at linuxgrrls.org]Em nome de Piero Colagrosso Enviada: quarta-feira, 6 de Agosto de 2003 21:13 Para: Java RXTX discussion Assunto: Re: [Rxtx] RS-485 Support Hi Trent, Thanks a lot for the advice. Just to make sure I understand, what you're suggesting is to use an RS-485 expansion board which natively supports the multipoint access (e.g., the Industio CP-132 board by Moxa or equivalent). If the above is correct, what would you suggest as an application-level API for interfacing with the RS-485 hardware? What we are looking to build is a data acquisition system based on the Bacnet MS/TP protocol (MS/TP is a data-link layer which sits on top of RS-485 and which we plan to implement ourselves). Our target platform is Linux based on an Intel-compatible hardware platform. Any further suggestions you have would be greatly appreciated! Thanks In Advance, Piero Trent Jarvi wrote: On Wed, 6 Aug 2003, Piero Colagrosso wrote: > Hi, > > I'm fairly new with RXTX, so please bear with me if my question is too basic. > > I'm looking to find what is the level of RS-485 support which RXTX provides. For example, does it support a multi-drop configuration where any of the drops can transmit? > > Is there any feature-level documentation or is the best thing to browse the code? > > Thanks In Advance, > > Piero > rs485 support is there for people who know about the issues. It's very ugly stuff to get into. You will find yourself worrying about things like kernel timing and other things (wire length) that can be replaced with a nominal chip. So as a person wanting you to do right, I suggest finding a hardware solution. Yes rxtx could do what you want but it wont save you money in the long run. _______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software_______________________________________________ Rxtx mailing list Rxtx at linuxgrrls.org http://hex.linuxgrrls.org/mailman/listinfo/rxtx --------------------------------- Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20030827/5940ebad/attachment-0064.html From taj at linuxgrrls.org Tue Aug 26 22:04:14 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:04:14 +0100 (BST) Subject: [Rxtx] Building 2.1.x from source In-Reply-To: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> References: <1809DA15308DD51180EE00508BCF219414FEB5D4@misnts1.dalsemi.com> Message-ID: On Tue, 26 Aug 2003, Scott Hughes wrote: > > cvs checkout -r commapi-0-0-1 rxtx-devel > > Okay, this worked for me. I was able to build the 2.1.7pre16 bins for linux > from this source. Also, I had a file called jcl.jar which somehow snuck > it's way into my jre/lib/ext folder and gave a conflicting definition for > gnu.io.RXTXCommDriver. That was a pain to track down.. > > Now, I'm getting an unexpected exception from the native lib. It looks like > it is happening during the constructor for CommPortIdentifier but is > actually occurring in RXTXCommDriver.testRead(). Here's the exact output: > > Devel Library > ========================================= > Native lib Version = RXTX-2.1-7pre16 > Java lib Version = RXTX-2.1-7pre16 > > An unexpected exception has been detected in native code outside the VM. > Unexpected Signal : 11 occurred at PC=0x4C403A1A > Function=Java_gnu_io_RXTXCommDriver_testRead+0x21A > Library=/usr/local/j2sdk1.4.1_02/jre/lib/i386/librxtxSerial-2.1-7pre16.so > > Current Java thread: > at gnu.io.RXTXCommDriver.testRead(Native Method) > at gnu.io.RXTXCommDriver.registerValidPorts(RXTXCommDriver.java:246) > at > gnu.io.RXTXCommDriver.registerScannedPorts(RXTXCommDriver.java:746) > at gnu.io.RXTXCommDriver.initialize(RXTXCommDriver.java:302) > at gnu.io.CommPortIdentifier.(CommPortIdentifier.java:68) > at > com.dalsemi.onewire.adapter.SerialService.getSerialPortIdentifiers(SerialSer > vice.java:195) > at > com.dalsemi.onewire.adapter.USerialAdapter.getPortNames(USerialAdapter.java: > 337) > at > com.dalsemi.onewire.OneWireAccessProvider.enumerateAllAdapters(OneWireAccess > Provider.java:199) > at FindiButtonsConsole.main(Unknown Source) > Hi Scott: I've seen this reported before with recent 1.4 JRE's. I suspect this is a issue related to the recent move to NPTL on Linux. The same code is not causing problems with 1.3 JRE's. So far, I've just been watching the 1.4 JRE and recommending 1.3 JRE. Some QA suites where run on early 1.4 but the 1.4 JRE's are mostly untested currently. The big change in Java since the initial tests was the NPTL on Linux. Which vendor's JRE does this show up with? One could just have that function return JNI_TRUE as a test but I suspect its going to blow up when you call open as the code is very simular. I read through the code and could not find a place where memory corruption (SIG 11) would happen. Maybe it's time to cut out the code in question and submit a test case to the vendor. From taj at linuxgrrls.org Tue Aug 26 22:13:44 2003 From: taj at linuxgrrls.org (Trent Jarvi) Date: Wed, 27 Aug 2003 05:13:44 +0100 (BST) Subject: [Rxtx] RS-485 Support In-Reply-To: <20030826235814.10900.qmail@web13907.mail.yahoo.com> References: <20030826235814.10900.qmail@web13907.mail.yahoo.com> Message-ID: On Tue, 26 Aug 2003, Piero Colagrosso wrote: > Hi Ricardo, > > Thanks for the explanations. > > Just one more thing I would like to verify with you, just to make sure I've understood correctly: > > I'm aware that there are also some RS-485 boards that also do the automatic transmit control in hardware (e.g., http://www.rs485.com/prsfc44t.html). Would I get the same advantage with this type of board as with the RS232->RS485 you mentioned in your initial response? Also, from an RXTX point of view could I still treat this RS-485 port as if it were an RS-232 port? > > Thanks, Piero: So far as I know, the RS485 boards have not been tested with rxtx. They should behave like other tty drivers and any missing functionality _should_ be handled in rxtx. While very possible, you may end up tinkering with the native code before the internal RS485 boards work. As a quick hack to test them, you could make say /dev/ttyS32 a symbolic link to whatever the kernel expects the port to be at. From david.garnier at trusted-logic.fr Wed Aug 27 01:49:50 2003 From: david.garnier at trusted-logic.fr (David Garnier) Date: Wed, 27 Aug 2003 09:49:50 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows In-Reply-To: References: <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> <5.2.0.9.0.20030826152819.02a90a18@mail.trusted-logic.fr> Message-ID: <5.2.0.9.0.20030827094444.02a3dd98@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a single Java class that can communicate with any Towitoko driver, serial or USB, Linux or Windows, without a single change. That's portability! Anyway, I also manage to compile the RXTX library under Windows. That wasn't really straightforward, but it worked in the end. For example, in the makefile, there is a rule for a libmex.dll and make throws an error. I don't think that its related to RXTX since I could not find this lib anywhere. Best Regards, David Garnier At 18:56 26/08/2003 +0100, you wrote: >On Tue, 26 Aug 2003, David Garnier wrote: > > > Hello, > > > > I have a problem accessing the COM port created by my USB card reader. > Long > > story short, it doesn't work with the official Comm API from Sun. Since it > > work beautifully under Linux with the RXTX library, I was wondering if > this > > library could work well under Windows. > > > > Now if you are still interested, here is the whole story. > > > > I have a Towitoko Chipdrive micro 130 (hence USB interface) and I want to > > use it under Windows 2000. For my application, I need to access the COM > > port directly, without going through PCSC or another interface. The > > documentation states that this is possible: the driver shoud create a > > "virtual COM port" for me to use, if PCSC is disabled. > > > > Furthermore, I need to do this under Java. I have installed the Java Comm > > API and it seems to working well with a serial reader. > > > > According to the Chipdrive Diagnostic software, the reader is attached to > > COM3 and the PCSC driver is not running. > > > > But when I try connect to the port from Java, I got a this message: > > > > No such Port COM: COM3 > > > > I think that the problem is related to the fact that the Comm API > > enumerates only the serial port recorded in the registry (it's in the FAQ > > for the Comm API). > > > > If I add a key for COM3 in the registry at > > HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM, I get this message > instead: > > > > Port COM COM3 is already used. > > > > I tried to connect to the port using Hyperterminal and it didn't worked > > either. > > > >Hyperterminal does not work? hmm. > >Can you verify that the USB is working with this w32 at all? > >When RXTX enumerates ports, it tries to open the port and does a timed out >read. If the OS does not complain (No such port for instance) then the >port is taken to be good. > >You can force the enumeration to accept port 3 in SerialImp.c with >something like (replace the function currently there): > >JNIEXPORT jboolean JNICALL RXTXCommDriver(testRead)( > JNIEnv *env, > jobject jobj, > jstring tty_name, > jint port_type >) >{ > > const char *name = (*env)->GetStringUTFChars(env, tty_name, 0); > if( !strcmp( name, "COM3" ) > { > printf("%s is good\n",name); > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_TRUE ); > } > (*env)->ReleaseStringUTFChars( env, tty_name, name ); > return( JNI_FALSE ); >} > >It would be random chance if rxtx did things the same way Sun does on w32. >If you do use rxtx on w32 you want to use 2.1-7pre16 > >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16.tar.gz >ftp://jarvi.dsl.frii.com/pub/rxtx-2.1-7pre16/binaries/ > >These are in package gnu.io so remove all previous packages before trying >it. Conflicts are common. Just change the code in your file to use >package gnu.io and it should work. -- except you say hyperterm is not >working... >_______________________________________________ >Rxtx mailing list >Rxtx at linuxgrrls.org >http://hex.linuxgrrls.org/mailman/listinfo/rxtx From david.garnier at trusted-logic.com Wed Aug 27 01:56:42 2003 From: david.garnier at trusted-logic.com (David Garnier) Date: Wed, 27 Aug 2003 09:56:42 +0200 Subject: SOLVEDRe: [Rxtx] Towitoko USB reader under Windows Message-ID: <5.2.0.9.0.20030827095638.02a3dee0@mail.trusted-logic.fr> Thanks Trent, but the problem was elsewhere. The solution is simple: do not use the Towitoko drivers at all, they do not allow you to access the COM port. Instead, uninstall this driver and install the drivers for the PL2303 chip inside the reader. These drivers are available other there: http://tech.prolific.com.tw/visitor/v_filebrw_result.asp With these drivers I can connect to the USB reader just like a serial reader, through COM3. I now have a singl